package com.test.jni.controller;

import com.sun.org.apache.xpath.internal.operations.String;
import com.test.jni.service.CallJnaService;
import com.test.jni.service.CallJniService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * KdcSdkController
 *
 * @Author XZ.Tan
 * @Date: 2021/10/26 15:07
 * @Version 1.0
 */
@RestController()
@RequestMapping("/java-c")
public class JavaCController {

    @Autowired
    private CallJnaService callJnaService;

    /**
     * 调用JNI实现方法
     *
     * @return
     */
    @RequestMapping("/callJniMethod")
    public Object callJniMethod() {
        CallJniService.callJniMethod();
        return "调用成功";
    }

    /**
     * 调用JNA实现方法
     *
     * @return
     */
    @RequestMapping("/callJnaMethod")
    public Object callJnaMethod() {
        callJnaService.callJnaMethod();
        return "调用成功";
    }

}